<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面试</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 20px;
            background-color: #f4f4f4;
        }
        .container {
            max-width: 800px;
            margin: auto;

            background: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        h1 {
            color: #333;
        }
        .question {
            margin-bottom: 20px;
        }
        .options {
            margin-left: 20px;
        }
        .option {
            margin-bottom: 10px;
        }
        button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #45a049;
        }
        #explanation {
            display: none;
            margin-top: 20px;
            padding: 10px;
            background-color: #e7f3fe;
            border-left: 6px solid #2196F3;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>面试刷题</h1>
    <div class="question">
        <h2>1. 以下哪个不是JavaScript的数据类型？</h2>
        <div class="options">
            <div class="option">
                <input type="radio" name="answer" id="optionA" value="A">
                <label for="optionA">A. String</label>
            </div>
            <div class="option">
                <input type="radio" name="answer" id="optionB" value="B">
                <label for="optionB">B. Number</label>
            </div>
            <div class="option">
                <input type="radio" name="answer" id="optionC" value="C">
                <label for="optionC">C. Boolean</label>
            </div>
            <div class="option">
                <input type="radio" name="answer" id="optionD" value="D">
                <label for="optionD">D. Character</label>
            </div>
        </div>
    </div>
    <button onclick="checkAnswer()">提交答案</button>
    <div id="explanation">
        <h3>解析：</h3>
        <p>正确答案是D. Character。JavaScript的基本数据类型包括String、Number、Boolean、Undefined、Null和Symbol（ES6新增）。Object是复杂数据类型。JavaScript没有Character这个数据类型，字符是以String类型存储的。</p>
    </div>
    <div class="login" style="margin: 120px">
        <form action="http://localhost:8080/v1/users/login" method="POST">
            <input type="text" name="username" placeholder="请输入用户名" >
            <input type="text" name="password" placeholder="请输入密码" >
            <input type="submit" value="登录">
        </form>
    </div>
</div>

<script>
    function checkAnswer() {
        var selectedOption = document.querySelector('input[name="answer"]:checked');
        if (selectedOption) {
            if (selectedOption.value === 'D') {
                alert('回答正确！');
            } else {
                alert('回答错误，请查看解析。');
            }
            document.getElementById('explanation').style.display = 'block';
        } else {
            alert('请选择一个选项！');
        }
    }
</script>
</body>
</html>